// var serverIP = window.location.host
import {Loading} from 'element-ui'
var networkErrorMsg="连接服务器失败",
    serverIP=window.location.host,
    // serverIP="192.168.102.98",
    // serverIP="192.168.102.108",
    // serverIP="192.168.102.111",
    // serverIP="192.168.102.94",
    // serverIP="192.168.100.171",
    newOcxVersion="1.0.8.0",
    // serverIP="192.168.101.110",
    // serverIP="192.168.102.94",
  webVersion="WEB-2022-09-16 14:46",
  ocxVersion="WebOcx-2020-04-21 17:50",
  validateItem={
    ip:/^((25[0-5]|2[0-4]\d|[01]?\d\d?)($|(?!\.$)\.)){4}$/,
    port:/^([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/
  },
    // serverIP="192.168.102.111",
    // serverIP="192.168.8.109",
  interfaceAddress='http://'+serverIP+'/LadderInspection',
  loading=function(msg) {
    console.log(Loading);
    var loadingIndex = Loading.service({
      target:'.app-main',
      lock: true,
      text: msg||'loading...',
      spinner: 'el-icon-loading',
      background: 'rgba(0, 0, 0, 0.7)'
    });
    return loadingIndex
}

export default {
  serverIP,
  networkErrorMsg,
  interfaceAddress,
  loading,
  validateItem,
  newOcxVersion,
  webVersion,
  ocxVersion
}

